//
//  UIImage+Ex.swift
//  
//
//  Created by tank on 2021/10/10.
//

import Foundation
import UIKit
import AppFoundation

extension Extension where Base == UIImage {
    
    public static func image(color: UIColor,
                      size: CGSize = CGSize(width: 1, height: 1)) -> UIImage? {
        
        UIGraphicsBeginImageContextWithOptions(size, false, 0)
        color.setFill()
        UIRectFill(CGRect(origin: CGPoint.zero, size: size))
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        return image
    }
}
